<template>
  <div></div>
</template>
<script setup lang="ts">
import { authRouter, LocalStorage, arrayMatchValue, memory } from 'jz-tool-lib'

console.log(memory);
console.log(memory( 1024 * 1024 * 0.6));
console.log(arrayMatchValue([
  { id: 1, name: '张三'},
  { id: 2, name: '李四'},
  { id: 3, name: '王五'}
], { id: 1 }, 'id'));
const data = {
  id: '256', // 代理商id
  checkAdvice: '222', // 代理商认证驳回原因
  checkStatus: 1, // 代理商认证状态 0:未提交 1:待审核 2:已通过 3:未通过
  virCompanyId: null, //代理商公司id
  existCallInterface: 1, //是否是呼叫中心接口客户 0:没有接口服务 1:只购买接口服务 2：两者都买
};
LocalStorage.batchSetItem({
  bd_agentId: data?.id, // 代理商id
  bd_checkAdvice: data?.checkAdvice, // 代理商认证驳回原因
  bd_checkStatus: data?.checkStatus, // 代理商认证状态 0:未提交 1:待审核 2:已通过 3:未通过
  bd_virCompanyId: data?.virCompanyId, //代理商公司id
  bd_existCallInterface: data?.existCallInterface, //是否是呼叫中心接口客户 0:没有接口服务 1:只购买接口服务 2：两者都买
});
/**
 * @params {Array} routerList 路由列表
 * @params {Array} 【可选】moduleList 模块名称列表。默认为空数组
 * @params {Array} 【可选】authList 权限列表。默认为空数组。如果为空，则默认为路由列表中所有路由的权限列表
 * @return 返回权限路由
 * */

const routerList = [
  {
    path: '/workBook/myAssignment',
    name: 'workBook.myAssignment',
    component: "() => import('@/views/work-book/MyAssignment.vue')",
    meta: {
      title: '我的任务',
      moduleTitle: '导航',
      icon: 'icon-icon-test',
      authKey: ['USE_TASK_DAY','USE_TASK_WEEK','USE_TASK_MONTH','USE_TASK_OVERDUE']
    }
  },
  {
    path: '/workBook/othersJournal',
    name: 'workBook.othersJournal',
    component: "() => import('@/views/work-book/OthersJournal.vue')",
    meta: {
      title: '他人日志',
      moduleTitle: '导航',
      icon: 'icon-lingdaotaren',
      authKey: ['OA_OTHER_TASK','OA_WEEKLY_PLAN_OTHER','OA_MONTHLY_PLAN_OTHER']
    }
  },
  {
    path: '/companySystem/systemListOwn',
    name: 'SystemListOwn',
    component: "() => import('@/views/company-system/components/SystemListOwn.vue')",
    meta: {
      title: '我的制度',
      moduleTitle: '导航'
    }
  },
  {
    path: '/companySystem/systemListRelease',
    name: 'SystemListRelease',
    component: "() => import('@/views/company-system/components/SystemListRelease.vue')",
    meta: {
      title: '已发布',
      moduleTitle: '管理',
      authKey: 'ZHIDU_MANAGE'
    }
  },
  {
    path: '/companySystem/systemListWait',
    name: 'SystemListWait',
    component: "() => import('@/views/company-system/components/SystemListWait.vue')",
    meta: {
      title: '待发布',
      moduleTitle: '管理',
      authKey: 'ZHIDU_MANAGE'
    }
  }
]
const moduleList = ['导航', '管理']
const authList = ['ZHIDU_MANAGE']
console.log(authRouter(routerList, moduleList, authList));
</script>
<style>
.top {
  position: fixed;
  right: 0;
  bottom: 0;
  background-color: red;
  width: 100px;
  height: 100px;
}
</style>
